#include "StdAfx.h"
#include "CorelSpyMediator.h"

CCorelSpyMediator::CCorelSpyMediator(DWORD dwSpyEnableTlsIndex)
: m_dwSpyEnableTlsIndex(dwSpyEnableTlsIndex)
{
    InitializeCriticalSection(&m_csLock);
}

CCorelSpyMediator::~CCorelSpyMediator()
{
    DeleteCriticalSection(&m_csLock);
    TlsFree(m_dwSpyEnableTlsIndex);
}

VOID CCorelSpyMediator::Reset()
{
    m_kSymbolEngine.Init(TRUE);
}

VOID CCorelSpyMediator::EnableSpy(BOOL bEnable)
{
    TlsSetValue(m_dwSpyEnableTlsIndex, (LPVOID)bEnable);
}

BOOL CCorelSpyMediator::IsSpyEnabled()
{
    return (BOOL)TlsGetValue(m_dwSpyEnableTlsIndex);
}

VOID CCorelSpyMediator::Enter()
{
    EnterCriticalSection(&m_csLock);
    LeaveCriticalSection(&m_csLock);
}

VOID CCorelSpyMediator::Leave()
{

}